import 'package:flutter/widgets.dart';
import 'package:flutter_sample/tab/bean/category_bean.dart';
import 'package:flutter_sample/tab/data/article_repo.dart';

class CategoryArticlesViewModel with ChangeNotifier {

  List<CategoryBean> _categories = [];
  List<CategoryBean> get categories => _categories;

  void requestCategories() {
    ArticleRepo.instance.getCategories().then((value) {
        _categories = value;
        notifyListeners();
    });
  }
}